{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/base.css" media="all">
<style>
	html {
		background-color: #f2f2f2 !important;
	}
	.layui-table td{
		padding: 4px 15px !important;
		height: 1.9rem !important;
		line-height: 1.9rem !important;
	}
	.layui-form-switch{
		margin-top: 0 !important;
	}
	.layui-tab-content{
		padding: 10px !important;
	}
	.layui-form-checkbox[lay-skin=primary] {
		padding-left: 1px!important;
	}
</style>
<body>

<div class="layui-fluid layui-anim-fadein">
	<div class="layui-card">

		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">


					<div class="layui-card-body">
						<div>
							<div class="layui-btn-container">
								<a class="layui-btn layui-btn-normal layui-btn-sm" onclick="zhiju_show('添加','{:url(\'edit\',[\'id\'=>0])}',700,800)">
									<i class="layui-icon layui-icon-add-circle-fine"></i>新增
								</a>
								<a class="layui-btn layui-btn-danger layui-btn-sm" data-url="{:url('delete')}" onclick="buttons.removeAll($(this),2);">
									<i class="layui-icon layui-icon-delete"></i>批量删除
								</a>
								<a class="layui-btn layui-btn-sm" style="background: #17a2b8" onclick="openAllCate($(this));">
									<i class="layui-icon layui-icon-util"></i><span class="show_text">展开</span>
								</a>
							</div>
						</div>
						<table class="layui-table layui-form" id="table" lay-size="sm">
							<thead>
							<tr>
								<th width="20"><input type="checkbox" lay-filter="list_all" lay-skin="primary"/></th>
								<th>菜单名称</th>
								<th>图标</th>
								<th>节点</th>

								<th>添加时间</th>
								<th>修改时间</th>
								<th>排序</th>
								<th>菜单状态</th>
								<th>操作</th>
							</thead>
							<tbody class="x-cate">
							{foreach name="menus" id="v"}
							<tr cate-id='{$v.id}' fid='{$v.pid}' level="{if $v.pid <= 0}0{else}{$v.lvl}{/if}" class="{if $v.lvl>1}layui-anim layui-anim-up layui-anim-downbit showAll{/if}" {if $v.lvl>1}style="display: none" {/if}>
								<td><input type="checkbox" lay-filter="list_checkbox" lay-skin="primary" value="{$v.id}"/></td>
								<td>
									{if $v.left_px > 0}
									<span style="padding-left: {$v.left_px}px;"></span>
									|— {if $v.lvl <= 2}<i class="layui-icon x-show" status='true'>&#xe623;</i>{/if}{$v.title}
									{else}
									<i class="layui-icon x-show" status='true'>&#xe623;</i>
									{$v.title}
									{/if}
								</td>
								<td><i class="layui-icon {$v.css}"></i></td>
								<td>{$v.name}</td>
								<td>{$v.create_time}</td>
								<td>{$v.update_time}</td>
								<td>{$v.sort}</td>
								<td class="td-status" style="text-align: center;">
									<input type="checkbox" lay-text="显示|隐藏" {if $v.status=='1'}checked{/if} lay-skin="switch" lay-filter="switch_old" url="{:url('update',['key'=>'status','id'=>$v.id])}"/>
								</td>
								<td class="td-manage">
									<div class="layui-btn-group">
										<button class="layui-btn layui-btn-sm" onclick="zhiju_show('编辑','{:url(\'edit\',[\'id\'=>$v.id,\'pid\'=>$v.pid])}',600,600)">编辑</button>
										{if $v.lvl <= 2}
										<button class="layui-btn layui-btn-warm layui-btn-sm" onclick="zhiju_show('添加子菜单','{:url(\'edit\',[\'id\'=>0,\'pid\'=>$v.id])}',800,900)">添加子菜单</button>
										{/if}
										{if $v.pid > 0}
										<button class="layui-btn-danger layui-btn layui-btn-sm" onclick="destroys(this,'{:url(\'delete\')}','{$v.id}')">删除</button>
										{/if}
									</div>
								</td>
							</tr>
							{/foreach}
							</tbody>
						</table>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>

</body>
{include file="public/footer" /}
</html>